//
//  NetworkSmAntiFraudPlugin.swift
//  LiveTrivia
//
//  Created by Lucas on 2018/6/27.
//  Copyright © 2018年 LiveTrivia. All rights reserved.
//

import Foundation
import Moya
//import Result
import SwifterSwift

final class NetworkSmAntiFraudPlugin: PluginType {
    
    func prepare(_ request: URLRequest, target: TargetType) -> URLRequest {
        
        var request = request
        
//        let deviceId = SmAntiFraud.shareInstance().getDeviceId()
//
//        if let server = target as? LiveMallService {
//            if case .wechatDeposit = server {
//                if case .requestParameters(var param, _) = target.task {
//                    param["deviceId"] = deviceId
//                    request.httpBody = param.jsonData()
//                }
//            }
//            if case .alipayDeposit = server {
//                if case .requestParameters(var param, _) = target.task {
//                    param["deviceId"] = deviceId
//                    request.httpBody = param.jsonData()
//                }
//            }
//            if case .guessing = server {
//                if case .requestParameters(var param, _) = target.task {
//                    param["deviceId"] = deviceId
//                    request.httpBody = param.jsonData()
//                }
//            }
//        }
//
//        if let server = target as? FastService {
//            if case .lock = server {
//                if case .requestParameters(var param, _) = target.task {
//                    param["deviceId"] = deviceId
//                    request.httpBody = param.jsonData()
//                }
//            }
//        }
        
        return request
    }
}
